package ACWing.WeeklyRace;
//3432. 二叉树

import java.util.Scanner;

public class BinaryTree {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int x=sc.nextInt();
        int y=sc.nextInt();
        while (x!=y){
            if(x>y){
                x=x/2;
            }else y=y/2;
        }
        System.out.println(x);

    }
}
